﻿/*
* Copyright 2024 NXP
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"


extern lv_timer_t  *digital_time_timer;

int screen_widget_digital_clock_time_hour_value;
int screen_widget_digital_clock_time_min_value;
int screen_widget_digital_clock_time_sec_value;

char screen_widget_digital_clock_time_meridiem[] = "AM";void setup_scr_screen_widget(lv_ui *ui)
{
	//Write codes screen_widget
	ui->screen_widget = lv_obj_create(NULL);
	lv_obj_set_size(ui->screen_widget, 480, 320);
	lv_obj_set_scrollbar_mode(ui->screen_widget, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_btn_on
	ui->screen_widget_btn_on = lv_btn_create(ui->screen_widget);
	ui->screen_widget_btn_on_label = lv_label_create(ui->screen_widget_btn_on);
	lv_label_set_text(ui->screen_widget_btn_on_label, "ON");
	lv_label_set_long_mode(ui->screen_widget_btn_on_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->screen_widget_btn_on_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->screen_widget_btn_on, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->screen_widget_btn_on, 80, 64);
	lv_obj_set_size(ui->screen_widget_btn_on, 50, 50);
	lv_obj_set_scrollbar_mode(ui->screen_widget_btn_on, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_btn_on, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_btn_on, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_btn_on, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->screen_widget_btn_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_btn_on, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_btn_on, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_btn_on, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_btn_on, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_btn_on, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_btn_off
	ui->screen_widget_btn_off = lv_btn_create(ui->screen_widget);
	ui->screen_widget_btn_off_label = lv_label_create(ui->screen_widget_btn_off);
	lv_label_set_text(ui->screen_widget_btn_off_label, "OFF");
	lv_label_set_long_mode(ui->screen_widget_btn_off_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->screen_widget_btn_off_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->screen_widget_btn_off, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->screen_widget_btn_off, 160, 64);
	lv_obj_set_size(ui->screen_widget_btn_off, 50, 50);
	lv_obj_set_scrollbar_mode(ui->screen_widget_btn_off, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_btn_off, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_btn_off, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_btn_off, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->screen_widget_btn_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_btn_off, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_btn_off, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_btn_off, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_btn_off, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_btn_off, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_switch
	ui->screen_widget_label_switch = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_switch, "开关");
	lv_label_set_long_mode(ui->screen_widget_label_switch, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_switch, 1, 80);
	lv_obj_set_size(ui->screen_widget_label_switch, 70, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_switch, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_switch, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_switch, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_switch, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_switch, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_switch, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_switch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_bar_progress
	ui->screen_widget_bar_progress = lv_bar_create(ui->screen_widget);
	lv_obj_set_style_anim_time(ui->screen_widget_bar_progress, 1000, 0);
	lv_bar_set_mode(ui->screen_widget_bar_progress, LV_BAR_MODE_SYMMETRICAL);
	lv_bar_set_value(ui->screen_widget_bar_progress, 100, LV_ANIM_ON);
	lv_obj_set_pos(ui->screen_widget_bar_progress, 78, 204);
	lv_obj_set_size(ui->screen_widget_bar_progress, 158, 22);
	lv_obj_set_scrollbar_mode(ui->screen_widget_bar_progress, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_bar_progress, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_bar_progress, 60, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_bar_progress, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_bar_progress, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_bar_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write style for screen_widget_bar_progress, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_bar_progress, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_bar_progress, lv_color_hex(0x2195f6), LV_PART_INDICATOR|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_bar_progress, 10, LV_PART_INDICATOR|LV_STATE_DEFAULT);

	//Write codes screen_widget_slider_show
	ui->screen_widget_slider_show = lv_slider_create(ui->screen_widget);
	lv_slider_set_range(ui->screen_widget_slider_show, 0,1000);
	lv_slider_set_value(ui->screen_widget_slider_show, 200, LV_ANIM_OFF);
	lv_obj_set_pos(ui->screen_widget_slider_show, 78, 149);
	lv_obj_set_size(ui->screen_widget_slider_show, 155, 22);
	lv_obj_set_scrollbar_mode(ui->screen_widget_slider_show, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_slider_show, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_slider_show, 60, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_slider_show, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_slider_show, 50, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_outline_width(ui->screen_widget_slider_show, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_slider_show, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write style for screen_widget_slider_show, Part: LV_PART_INDICATOR, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_slider_show, 255, LV_PART_INDICATOR|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_slider_show, lv_color_hex(0x2195f6), LV_PART_INDICATOR|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_slider_show, 50, LV_PART_INDICATOR|LV_STATE_DEFAULT);

	//Write style for screen_widget_slider_show, Part: LV_PART_KNOB, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_widget_slider_show, 255, LV_PART_KNOB|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_slider_show, lv_color_hex(0x2195f6), LV_PART_KNOB|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_slider_show, 50, LV_PART_KNOB|LV_STATE_DEFAULT);

	//Write codes screen_widget_ddlist_show
	ui->screen_widget_ddlist_show = lv_dropdown_create(ui->screen_widget);
	lv_dropdown_set_options(ui->screen_widget_ddlist_show, "list1\nlist2\nlist3");
	lv_obj_set_pos(ui->screen_widget_ddlist_show, 78, 256);
	lv_obj_set_size(ui->screen_widget_ddlist_show, 156, 29);
	lv_obj_set_scrollbar_mode(ui->screen_widget_ddlist_show, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_ddlist_show, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_text_color(ui->screen_widget_ddlist_show, lv_color_hex(0x0D3055), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_ddlist_show, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->screen_widget_ddlist_show, 1, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_opa(ui->screen_widget_ddlist_show, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_color(ui->screen_widget_ddlist_show, lv_color_hex(0xe1e6ee), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_ddlist_show, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_ddlist_show, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_ddlist_show, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_ddlist_show, 3, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_ddlist_show, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_ddlist_show, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_ddlist_show, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write style state: LV_STATE_CHECKED for &style_screen_widget_ddlist_show_extra_list_selected_checked
	static lv_style_t style_screen_widget_ddlist_show_extra_list_selected_checked;
	ui_init_style(&style_screen_widget_ddlist_show_extra_list_selected_checked);
	
	lv_style_set_text_color(&style_screen_widget_ddlist_show_extra_list_selected_checked, lv_color_hex(0xffffff));
	lv_style_set_text_font(&style_screen_widget_ddlist_show_extra_list_selected_checked, &lv_font_montserratMedium_12);
	lv_style_set_border_width(&style_screen_widget_ddlist_show_extra_list_selected_checked, 1);
	lv_style_set_border_opa(&style_screen_widget_ddlist_show_extra_list_selected_checked, 255);
	lv_style_set_border_color(&style_screen_widget_ddlist_show_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
	lv_style_set_radius(&style_screen_widget_ddlist_show_extra_list_selected_checked, 3);
	lv_style_set_bg_opa(&style_screen_widget_ddlist_show_extra_list_selected_checked, 255);
	lv_style_set_bg_color(&style_screen_widget_ddlist_show_extra_list_selected_checked, lv_color_hex(0x00a1b5));
	lv_obj_add_style(lv_dropdown_get_list(ui->screen_widget_ddlist_show), &style_screen_widget_ddlist_show_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);

	//Write style state: LV_STATE_DEFAULT for &style_screen_widget_ddlist_show_extra_list_main_default
	static lv_style_t style_screen_widget_ddlist_show_extra_list_main_default;
	ui_init_style(&style_screen_widget_ddlist_show_extra_list_main_default);
	
	lv_style_set_max_height(&style_screen_widget_ddlist_show_extra_list_main_default, 90);
	lv_style_set_text_color(&style_screen_widget_ddlist_show_extra_list_main_default, lv_color_hex(0x0D3055));
	lv_style_set_text_font(&style_screen_widget_ddlist_show_extra_list_main_default, &lv_font_montserratMedium_12);
	lv_style_set_border_width(&style_screen_widget_ddlist_show_extra_list_main_default, 1);
	lv_style_set_border_opa(&style_screen_widget_ddlist_show_extra_list_main_default, 255);
	lv_style_set_border_color(&style_screen_widget_ddlist_show_extra_list_main_default, lv_color_hex(0xe1e6ee));
	lv_style_set_radius(&style_screen_widget_ddlist_show_extra_list_main_default, 3);
	lv_style_set_bg_opa(&style_screen_widget_ddlist_show_extra_list_main_default, 255);
	lv_style_set_bg_color(&style_screen_widget_ddlist_show_extra_list_main_default, lv_color_hex(0xffffff));
	lv_obj_add_style(lv_dropdown_get_list(ui->screen_widget_ddlist_show), &style_screen_widget_ddlist_show_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write style state: LV_STATE_DEFAULT for &style_screen_widget_ddlist_show_extra_list_scrollbar_default
	static lv_style_t style_screen_widget_ddlist_show_extra_list_scrollbar_default;
	ui_init_style(&style_screen_widget_ddlist_show_extra_list_scrollbar_default);
	
	lv_style_set_radius(&style_screen_widget_ddlist_show_extra_list_scrollbar_default, 3);
	lv_style_set_bg_opa(&style_screen_widget_ddlist_show_extra_list_scrollbar_default, 255);
	lv_style_set_bg_color(&style_screen_widget_ddlist_show_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
	lv_obj_add_style(lv_dropdown_get_list(ui->screen_widget_ddlist_show), &style_screen_widget_ddlist_show_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);

	//Write codes screen_widget_digital_clock_time
	bool screen_widget_digital_clock_time_timer_enabled = false; //	static bool screen_widget_digital_clock_time_timer_enabled = false;
	ui->screen_widget_digital_clock_time = lv_dclock_create(ui->screen_widget, "11:25:50 AM");
	if (!screen_widget_digital_clock_time_timer_enabled) {
		
		screen_widget_digital_clock_time_min_value = 25;
		screen_widget_digital_clock_time_hour_value = 11;
		screen_widget_digital_clock_time_sec_value = 50;
		
		digital_time_timer = lv_timer_create(screen_widget_digital_clock_time_timer, 1000, NULL);
		screen_widget_digital_clock_time_timer_enabled = true;
	}
	lv_obj_set_pos(ui->screen_widget_digital_clock_time, 322, 53);
	lv_obj_set_size(ui->screen_widget_digital_clock_time, 143, 30);
	lv_obj_set_scrollbar_mode(ui->screen_widget_digital_clock_time, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_digital_clock_time, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_radius(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_digital_clock_time, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_digital_clock_time, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_digital_clock_time, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_digital_clock_time, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_widget_digital_clock_time, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_digital_clock_time, 7, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_digital_clock_time, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_qrcode_barcode
	ui->screen_widget_qrcode_barcode = lv_qrcode_create(ui->screen_widget, 140, lv_color_hex(0x2C3224), lv_color_hex(0xffffff));
	const char * screen_widget_qrcode_barcode_data = "https://www.china-core.com/";
	lv_qrcode_update(ui->screen_widget_qrcode_barcode, screen_widget_qrcode_barcode_data, strlen(screen_widget_qrcode_barcode_data));
	lv_obj_set_pos(ui->screen_widget_qrcode_barcode, 324, 162);
	lv_obj_set_size(ui->screen_widget_qrcode_barcode, 140, 140);

	//Write codes screen_widget_label_slider
	ui->screen_widget_label_slider = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_slider, "滑动条");
	lv_label_set_long_mode(ui->screen_widget_label_slider, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_slider, 8, 150);
	lv_obj_set_size(ui->screen_widget_label_slider, 70, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_slider, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_slider, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_slider, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_slider, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_slider, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_slider, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_slider, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_progress
	ui->screen_widget_label_progress = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_progress, "进度条");
	lv_label_set_long_mode(ui->screen_widget_label_progress, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_progress, 5, 205);
	lv_obj_set_size(ui->screen_widget_label_progress, 70, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_progress, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_progress, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_progress, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_progress, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_progress, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_progress, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_progress, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_ddlist
	ui->screen_widget_label_ddlist = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_ddlist, "下拉框");
	lv_label_set_long_mode(ui->screen_widget_label_ddlist, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_ddlist, 5, 265);
	lv_obj_set_size(ui->screen_widget_label_ddlist, 70, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_ddlist, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_ddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_ddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_ddlist, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_ddlist, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_ddlist, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_ddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_datetime
	ui->screen_widget_label_datetime = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_datetime, "当前时间");
	lv_label_set_long_mode(ui->screen_widget_label_datetime, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_datetime, 234, 60);
	lv_obj_set_size(ui->screen_widget_label_datetime, 80, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_datetime, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_datetime, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_datetime, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_datetime, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_datetime, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_datetime, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_datetime, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_barcode
	ui->screen_widget_label_barcode = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_barcode, "二维码");
	lv_label_set_long_mode(ui->screen_widget_label_barcode, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_barcode, 254, 216);
	lv_obj_set_size(ui->screen_widget_label_barcode, 70, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_barcode, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_barcode, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_barcode, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_barcode, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_barcode, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_barcode, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_barcode, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_textshow
	ui->screen_widget_label_textshow = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_textshow, "https://www.china-core.com/");
	lv_label_set_long_mode(ui->screen_widget_label_textshow, LV_LABEL_LONG_SCROLL);
	lv_obj_set_pos(ui->screen_widget_label_textshow, 324, 114);
	lv_obj_set_size(ui->screen_widget_label_textshow, 134, 20);
//	lv_obj_set_scrollbar_mode(ui->screen_widget_label_textshow, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_textshow, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_textshow, lv_color_hex(0xf66d1e), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_textshow, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_textshow, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_textshow, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_textshow, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_label_text
	ui->screen_widget_label_text = lv_label_create(ui->screen_widget);
	lv_label_set_text(ui->screen_widget_label_text, "文本显示");
	lv_label_set_long_mode(ui->screen_widget_label_text, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->screen_widget_label_text, 234, 114);
	lv_obj_set_size(ui->screen_widget_label_text, 80, 20);
	lv_obj_set_scrollbar_mode(ui->screen_widget_label_text, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_label_text, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_label_text, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_label_text, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->screen_widget_label_text, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_label_text, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_label_text, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_widget_btn_return
	ui->screen_widget_btn_return = lv_imgbtn_create(ui->screen_widget);
	lv_obj_add_flag(ui->screen_widget_btn_return, LV_OBJ_FLAG_CHECKABLE);
	lv_imgbtn_set_src(ui->screen_widget_btn_return, LV_IMGBTN_STATE_RELEASED, NULL, &_5_1_60x60, NULL);
	lv_obj_add_flag(ui->screen_widget_btn_return, LV_OBJ_FLAG_CHECKABLE);
	ui->screen_widget_btn_return_label = lv_label_create(ui->screen_widget_btn_return);
	lv_label_set_text(ui->screen_widget_btn_return_label, "");
	lv_label_set_long_mode(ui->screen_widget_btn_return_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->screen_widget_btn_return_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->screen_widget_btn_return, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->screen_widget_btn_return, 5, 5);
	lv_obj_set_size(ui->screen_widget_btn_return, 60, 60);
	lv_obj_set_scrollbar_mode(ui->screen_widget_btn_return, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_widget_btn_return, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_img_opa(ui->screen_widget_btn_return, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_widget_btn_return, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_widget_btn_return, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_widget_btn_return, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_widget_btn_return, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write style for screen_widget_btn_return, Part: LV_PART_MAIN, State: LV_STATE_PRESSED.
	lv_obj_set_style_img_opa(ui->screen_widget_btn_return, 255, LV_PART_MAIN|LV_STATE_PRESSED);
	lv_obj_set_style_text_color(ui->screen_widget_btn_return, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_PRESSED);
	lv_obj_set_style_text_font(ui->screen_widget_btn_return, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_PRESSED);
	lv_obj_set_style_shadow_width(ui->screen_widget_btn_return, 0, LV_PART_MAIN|LV_STATE_PRESSED);

	//Write style for screen_widget_btn_return, Part: LV_PART_MAIN, State: LV_STATE_CHECKED.
	lv_obj_set_style_img_opa(ui->screen_widget_btn_return, 255, LV_PART_MAIN|LV_STATE_CHECKED);
	lv_obj_set_style_text_color(ui->screen_widget_btn_return, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_CHECKED);
	lv_obj_set_style_text_font(ui->screen_widget_btn_return, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_CHECKED);
	lv_obj_set_style_shadow_width(ui->screen_widget_btn_return, 0, LV_PART_MAIN|LV_STATE_CHECKED);

	//Update current screen layout.
	lv_obj_update_layout(ui->screen_widget);

	
	//Init events for screen.
	events_init_screen_widget(ui);
}
